Imports AUtility

Partial Public Class Path

    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Write("Server MapPath: " + Server.MapPath("") + "<br>")
    End Sub

    Protected Sub btnBackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackup.Click
        Try

            Dim sqlQuery As String = String.Format("BACKUP DATABASE {0} TO DISK = '{1}\{0}.bak'", txtDatabase.Text, Server.MapPath(""))
            Dim connectionString As String = String.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}", txtServer.Text, txtDatabase.Text, txtUser.Text, txtPassword.Text)
            DataAccess.ExecuteSql(connectionString, sqlQuery)

            hypBackup.Text = txtDatabase.Text
            hypBackup.NavigateUrl = txtDatabase.Text + ".zip"

            Response.Write("<br><br>" + sqlQuery)

        Catch ex As Exception
            Response.Write(ex.Message)
        End Try
    End Sub
End Class